/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Tetravex;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;
import javax.swing.*;

/**
 *
 * @author alrz
 */
public class NavBar extends JMenuBar implements ActionListener
{
    private Window myWindow;
    
    public NavBar(Window myWindow)
    {
        this.myWindow = myWindow;
        this.createNavBar();
    }
    
    private void createNavBar()
    {
      this.add(new JMenu("Hola"));
      /*
      List<MenuObject> menusObject = MenuStructure.getMenus();
        for( MenuObject menuObject : menusObject )
        {
           JMenu menu = this.addMenu(menuObject);
           List<MenuObject> itemsObject = MenuStructure.getMenuItems(menuObject);
           for( MenuObject itemObject : itemsObject )
           {
               this.addMenuItem(menu, itemObject);
           }
           menuBar.add(menu);
        }
        super.setJMenuBar(menuBar);
        * /
    }
    
    private JMenu addMenu( MenuObject menuObject )
    {
        JMenu menu = new JMenu( menuObject.getName() );
        menu.setMnemonic( menuObject.getMnemonic() );
        if( menuObject.hasAccelerator() )
        {
            menu.setAccelerator( menuObject.getAccelerator() );
        }
        return menu;
    }
    
    private void addMenuItem( JMenu parent, MenuObject itemObject )
    {
        if( itemObject.isSeparator() )
        {
            parent.addSeparator();
            return;
        }
        JMenuItem item = new JMenuItem(itemObject.getName());
        if( itemObject.hasMnemonic() )
        {
            item.setMnemonic(itemObject.getMnemonic());
        }
        if( itemObject.hasAccelerator() )
        {
            item.setAccelerator( itemObject.getAccelerator() );
        }
        item.setActionCommand(itemObject.getName());
        item.addActionListener(this);
        parent.add(item);
    }*/
    }
    @Override
    public void actionPerformed(ActionEvent e)
    {
        //throw new UnsupportedOperationException("Not supported yet.");
    }
    
}
